package com.appcenter.jz.config;

import com.appcenter.jz.config.ErrorJsonResult;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.ArrayList;

@ApiModel(value="返回值信息",description ="返回值信息" )
public class JsonResult<T> {

    @ApiModelProperty(value = "",example = "",required = false,hidden = true)
    private String targetUrl=null;
    public String getTargetUrl(){return this.targetUrl;}
    public void setTargetUrl(String targetUrl){
        this.targetUrl=targetUrl;
    }

    @ApiModelProperty(value = "是否执行成功",example = "",required = false)
    private Boolean success=null;
    public Boolean getSuccess(){return this.success;}
    public void setSuccess(Boolean targetUrl){
        this.success=targetUrl;
    }

    @ApiModelProperty(value = "错误信息",example = "",required = false)
    private ErrorJsonResult error=null;
    public ErrorJsonResult getError(){return this.error;}
    public void setError(ErrorJsonResult error){
        if(error!=null){
            error.setStackTrace(new StackTraceElement[0]);
        }
        this.error=error;
        this.success=false;
    }


    @ApiModelProperty(value = "",example = "",required = false,hidden = true)
    private String unAuthorizedRequest=null;

    @ApiModelProperty(value = "返回值信息",example = "",required = false)
    private T result = null;

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.success=true;
        this.result = result;
    }
}
